package lis.r1.wyd1;

public class Main implements Runnable {
	
	private String name;
	private int delay;

	public Main(String name, int delay){
		super();
		this.name = name;
		this.delay = delay;
	}

	public Main(){
		super();
	}
	
	@Override
	public void run() {

		for (int i = 0; i < 5; i++) {
			System.out.println(name + " " + i);
			try {
				Thread.sleep(delay);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

	public static void main(String[] args) {
		
		Main main = new Main();
		Thread t = new Thread(main);
		t.start();

		new Thread(new Main("Ala ma kota.", 200)).start();
		new Thread(new Main("Ala i As.", 500)).start();
		System.out.println(Thread.currentThread().getName());
	}

}
